<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<c:set var="path" value="${pageContext.request.contextPath}" />
<!DOCTYPE HTML>
<html>
<jsp:include page="../../common/head.jsp"></jsp:include>
<body>
<article class="page-container">
	<form id="form-student-add" action="${path}/student/add" method="post" class="form form-horizontal">
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span
						class="c-red">*</span>学号：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" placeholder="学号"
							id="orderNo" name="orderNo">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span
						class="c-red">*</span>姓名：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" placeholder="姓名"
							id="name" name="name">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span
						class="c-red">*</span>性别:</label>
					<div class="formControls col-xs-8 col-sm-9 skin-minimal">
						<div class="radio-box">
							<input name="sex" value="01" type="radio" checked>
							<label for="sex-1">男</label>
						</div>
						<div class="radio-box">
							<input name="sex" value="02" type="radio">
							<label for="sex-2">女</label>
						</div>
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3">专业：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<span class="select-box">
						<select class="select" size="1" name="major">
							<option value="" selected>请选择专业</option>
							<option value="01">计算机</option>
							<option value="02">软件工程</option>
						</select>
						</span>
					 </div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span
						class="c-red">*</span>出生日期：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" name="birthday" onfocus="WdatePicker()" class="input-text Wdate">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span
						class="c-red">*</span>总学分：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" placeholder="总学分"
							id="totalCredit" name="totalCredit">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span
						class="c-red">*</span>备注：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" placeholder="备注"
							id="remark" name="remark">
					</div>
				</div>
				<div class="row cl">
					<label class="form-label col-xs-4 col-sm-3"><span
						class="c-red">*</span>照片：</label>
					<div class="formControls col-xs-8 col-sm-9">
						<input type="text" class="input-text" value="" placeholder="照片"
							id="imgPath" name="imgPath">
					</div>
				</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<input class="btn btn-primary radius" type="submit"
						value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>
	
	<jsp:include page="../../common/foot.jsp"></jsp:include>
	
	<script type="text/javascript">
		$(function() {
			$("#form-student-add").validate({
				rules : {
							orderNo:{
								required : true
							},
							name:{
								required : true
							},
							sex:{
								required : true
							},
							major:{
								required : true
							},
							totalCredit:{
								required : true
							}
				},
				onkeyup : false,
				focusCleanup : true,
				success : "valid",
				submitHandler : function(form) {
					var $form=$(form);
					$.post($form.attr('action'),$form.serialize(),function(result){
						if(checkCode(result)){
							$form.find('input[type="text"],input[type="password"]').val('');
							layer.alert('添加成功', {
								  icon: 1,
								  skin: 'layer-ext-moon' //该皮肤由layer.seaning.com友情扩展。关于皮肤的扩展规则，去这里查阅
							});
						}
					},'json').error(function(){
						serverError();
					});
				}
			});
		});
	</script>
</body>
</html>